#include<sys/types.h>
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>

int j=200;
int main()
{
		j+=1;
		int i;
	int k=100;
	i+=1;
	pid_t id=fork();
	k+=1;
	i=100;
	j+=1;
	printf("before forkn");
	if(id<0)
	{
		perror("fork");
		exit(1);
	}
	else if(id==0)
	{
		j+=1;
			k+=1;
			printf("child ->i=%d,j=%d,k=%d\n",i++,j++,k++);
	    exit(1);
	}
	else
	{
	   	sleep(3);
				j+=1;
		printf("parents->i=%d,j=%dk=%d\n",i,j,k);
	}
	return 0;

}
